export default function createElement (type, props, ...children) {
    const childElement = [].concat(...children).reduce((result,child) => {
        if (child !== null || child !== true || child !== false) {
            if (child instanceof Object) {
                result.push(child)
            } else {
                result.push(createElement ('text', {textContent: child}))
            }
        }
        return result
    }, [])
    return {
        type, // tag
        props: Object.assign({children: childElement}, props),
        children: childElement
    }
}